package com.wdhcr.repository;

import com.wdhcr.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Set;

public interface UserRepository extends JpaRepository<User,Long> {

    User findByOpenid(String openid);

    @Query("select u.openid from User u")
    Set<String> findOpenidAll();


    @Query("select u.openid,u.name from User u where u.id = ?1")
    String findByid(Long id);
}
